﻿/// <reference Path="../jquery-1.3.2-vsdoc.js" />
$(function () {
    window.AddToCar = function (productId) {
        $.post(window.consult_car_url, {
            ProductId: productId, count: 1, rnd: Math.random()
        }, function (result) {
            result = $(result);
            window.CloseDialog = function () { result.dialog("close") };
            result.dialog({ width: 500, modal: true, closeText: "×",
                close: function () { $(this).dialog("destroy") }
            }); ReLoadMiNiCar();
        });
    };
    window.backConsult = function () {
        window.location.href = window.consult_this_url;
    };
    $("#btnConsult").click(function () {
        $.post(window.consult_search_url, { productId: window.consult_pid, key: $("#txtConsultKey").val() }, function (result) {
            $("#div_consult_list").html(result);
        });
    });
    $("#divAppend").find("textarea").focus(function () {
        if (parseInt(window.consult_uid) <= 0) {
            if (confirm("您目前未登陆，现在登陆吗？")) {
                window.location.href = window.consult_login_url + "?returnUrl=" + document.location.href;
            } else { $(this).blur(); }
        }
    });
    if (/Login.aspx/.test(document.referrer) || parseInt(window.consult_cid) > 0) {
        window.location.hash = "acform";
    }
});